<!DOCTYPE html>
<html>

<head>
    {include file="Public/header"}
    <link href="__STATIC__/layout/css/gyq.css" rel="stylesheet">
    <link rel="stylesheet" href="__STATIC__/layout/css/demo.css" type="text/css">
    <style>
        .is_hiddenTr{display: none;}
    </style>

</head>

<body style="color:#333;padding:3px;overflow-x: auto;">
<div class="page-heade clearfix">
    <h2 class="title-color text-center">
        <a href="{:url('cgindex')}" class="col-md-6 title_color H_right H_active"
           style="display: inline-block;font-size: 16px">不予核销记录查询-常规</a>
        <a href="{:url('index')}" class="col-md-6 title_color"
           style="color:#333;font-size: 16px;display: inline-block;">不予核销记录查询-非常规和进场</a>
    </h2>
</div>
<!-- 标题 -->
<!--<div class="page-heade">
    <h1 class="title_color">不予核销记录查询</h1>
</div>-->
<!-- 标题 -->
<div class="row-margin-top">
    <form action="" class="form-inline">
        <table class="row-margin-top tab-content table-bordered  table" border="1">
            <tr>
                <td><label for="" class="form-label">核销面单编号</label></td>
                <td><input type="text" class="form-control" name="hxmdbh" value="{$hxmdbh}"></td>
                <td><label for="" class="form-label">原申请编号</label></td>
                <td><input type="text" class="form-control" name="ysqbh" value="{$ysqbh}"></td>
                <td><label for="" class="form-label">经销商名称</label></td>
                <td><input type="text" class="form-control" name="jxsmc" value="{$jxsmc}"></td>
            </tr>
            <tr>
                <td><label for="" class="form-label">网点名称</label></td>
                <td><input type="text" class="form-control" name="wdmc" value="{$wdmc}"></td>
                <td><label for="" class="form-label">品牌</label></td>
                <td>
                    <select name="pp" id="pp" class="form-control" style="min-width: 100px;width: 100px">
                        <option value="">请选择</option>
                        {volist name="brands" id="row"}
                        <option value="{$row.id}" {if $pp==$row.id}selected{/if}>{$row.brand_name}</option>
                        {/volist}
                    </select>
                </td>
                <td><label for="sjfykm" class="form-label">三级费用科目</label></td>
                <td>
                    <select name="sjfykm" id="sjfykm" class="form-control" style="min-width: 100px;width: 100px">
                        <option value="">请选择</option>
                        {volist name="fykm3" id="row"}
                        <option value="{$row.id}" {if $sjfykm==$row.id}selected{/if}>{$row.title}</option>
                        {/volist}
                    </select>
                </td>
            </tr>
            <tr>
                <td><label for="" class="form-label">申请人</label></td>
                <td><input type="text" class="form-control" name="sqr" value="{$sqr}"></td>
                <td>
                    <div class="form-group">
                        申请时间
                    </div>
                </td>
                <td>
                    <div class="form-group">
                        <input type="text" id="start" class="form-control layer-date "
                               style="width: 100px;min-width: 100px;display: inline-block;" name="start" value="{$start}">
                    </div>
                    <div class="form-group">
                        至
                    </div>
                    <div class="form-group">
                        <input type="text" class="form-control layer-date"
                               style="width: 100px;min-width: 100px;display: inline-block;" id="end"
                               name="end" value="{$end}">
                    </div>
                </td>
                <td colspan="2" class="text-center">
                    <button class="btn btn-info query">查询</button>
                    <button class="btn btn-info emptyIf" type="button">清空查询条件</button>
                    <button class="btn btn-info LendExcel" type="button">导出excel</button>
                </td>
            </tr>
        </table>
    </form>
    <table class="table table-striped table-bordered table-hover text-center" id="verifytable">
        <tr class="info text-center">
            <th class="text-center">序号</th>
            <th class="text-center">核销面单编号</th>
            <th class="text-center">原明细编号</th>
            <th class="text-center">原申请类型</th>
            <th class="text-center">经销商名称</th>
            <th class="text-center">系统名称</th>
            <th class="text-center">网点名称</th>
            <th class="text-center">品牌</th>
            <th class="text-center">三级费用科目</th>
            <th class="text-center">已核销金额</th>
            <th class="text-center">未核销金额</th>
            <th class="text-center">费用计入部门</th>
            <th class="text-center">操作记录</th>
            <th class="text-center">申请人</th>
            <th class="text-center">核销申请日期</th>
            <th class="text-center">备注</th>
        </tr>
        <tbody>
        {volist name="data" id="row" key="k"}
        <tr>
            <td>{$k+(request()->param('page')?request()->param('page'):1-1)*10}</td>
            <td><a href="{:url('tihexiao/view',['id'=>$row.id])}" class="J_menuItem">{$row.hxmdbh}</a></td>
            <td>
                {if $row.type_id==0}
                <a href="{:url('ti_apply2/dataview',['id'=>$row.ymxid])}" class="J_menuItem">{$row.ydbh}_{$row.ymxbh}</a>
                {else}
                <a href="{:url('tijinchang/dataview',['id'=>$row.ymxid])}" class="J_menuItem">{$row.ydbh}_{$row.ymxbh}</a>
                {/if}
            </td>
            <td>常规促销申请</td>
            <td>{$row.jxs_title}</td>
            <td>{$row.system_title}</td>
            <td>{$row.net_title}</td>
            <td>{$row.brand}</td>
            <td>{$row.sjfykm}</td>
            <td class="ObjectNum">{$row.hx_yihexiao2}</td>
            <td class="ObjectNum">{$row.whxje}</td>
            <td>{if $row.jrbm}{$row.jrbm}{else}无{/if}</td>
            <td><a href="javascript:;" class="is_verifyA">{$row.czjl}</a></td>
            <td>{$row.cuser}</td>
            <td>{$row.ctime}</td>
            <td>{$row.beizhu}</td>
        </tr>
        <tr class="is_hiddenTr">
            <td colspan="16">
                <table class="table table-bordered text-left">
                    {volist name="row.czjlxq" id="row2"}
                    <tr>
                        <td><span class="colorRed font-bold">{$row2.cuser}</span> <span class="colorRed font-bold">{$row2.ctime}</span>:{$row2.brief}</td>
                    </tr>
                    {/volist}
                    <tr>
                        <td><button class="btn btn-warning closeBtn" type="button">关闭</button></td>
                    </tr>
                </table>
            </td>
        </tr>
        {/volist}

        <tr class="trTotal1">
            <td colspan="9">合计：</td>
            <td class="ObjectNum">{$heji_yhx}</td>
            <td class="ObjectNum">{$heji_whx}</td>
            <td colspan="5"></td>
        </tr>
        </tbody>
    </table>
    <h5 class="text-center">
        {$page}
    </h5>

</div>
<!-- 全局js -->
{include file="Public/footer"}
<!-- <script src="js/plugins/metisMenu/jquery.metisMenu.js"></script> -->
<script src="__STATIC__/layout/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="__STATIC__/layout/js/plugins/layer/laydate/laydate.js"></script>
<script src="__STATIC__/layout/js/common.js"></script>
<script src="__STATIC__/layout/js/contabs_sub.js"></script>
<script>

    //日期范围限制
    var start = {
        elem: '#start',
        format: 'YYYY/MM/DD',
        max: '2099-06-16 23:59:59', //最大日期
        istime: true,
        istoday: false,
        choose: function (datas) {
            end.min = datas; //开始日选好后，重置结束日的最小日期
            end.start = datas //将结束日的初始值设定为开始日
        }
    };
    var end = {
        elem: '#end',
        format: 'YYYY/MM/DD',
        max: '2099-06-16 23:59:59',
        istime: true,
        istoday: false,
        choose: function (datas) {
            start.max = datas; //结束日选好后，重置开始日的最大日期
        }
    };
    laydate(start);
    laydate(end);
    $(document).ready(function () {
        // $("#verifytable tbody tr td").find('.duigou')
        /*格式化数字金额*/
        var $ObjectNum = $(".ObjectNum");
        toNum($ObjectNum);
        /*为已生效的核销申请字体加粗*/
        var $duigou = $(".duigou");
        $duigou.parent().addClass("font-bold");
        /*弹出隐藏的tr*/
        $(document).on("click",'.is_verifyA',function(){

            var $is_hiddenTr=$(this).parent().parent().next('tr')
            if($is_hiddenTr.hasClass('is_hiddenTr')){
                $is_hiddenTr.removeClass('is_hiddenTr')
            }else{
                $is_hiddenTr.addClass('is_hiddenTr')
            }
        })
        $(document).on("click",'.closeBtn',function(){
            $(this).parent().parent().parent().parent().parent().parent().addClass('is_hiddenTr')
        })
        $('.emptyIf').on('click',function () {
            var form = $(this).closest('form')
            form.find('input[type=text]').each(function () {
                $(this).val('')
            })
            form.find('select').each(function () {
                $(this).val('')
            })
            form.submit()
        })
        $('.LendExcel').on('click',function () {
            var param = $('#form1').serialize()
            window.open('{:url("cgexcel")}?'+param)
        })
    })

</script>
</body>

</html>
